package com.xinxin.leetcode.problem412;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ShiXinXin
 * @date 2019-12-16 1:51
 */
public class Solution {
    public List<String> fizzBuzz(int n) {
        List<String> list = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            if (i % 15 == 0) {
                list.add("FizzBuzz");
            } else if (i % 5 == 0) {
                list.add("Buzz");
            } else if (i % 3 == 0) {
                list.add("Fizz");
            } else {
                list.add(String.valueOf(i));
            }
        }
        return list;
    }

    public static void main(String[] args) {
        System.out.println(new Solution().fizzBuzz(15));
    }
}
